#ifndef __XPICO_BATTERY_H__
#define __XPICO_BATTERY_H__

#include <sys/types.h>
#include "uv.h"

__BEGIN_DECLS

enum {
	BUS_I2C = 0,
};

struct battery;

typedef void (*notify_cb)(void *context, float vol);

struct battery *battery_create(uv_loop_t *loop, int8_t bus_type, int8_t bus_id);
void battery_destroy(struct battery *thiz);

int32_t battery_start_monitor(struct battery *thiz);
int32_t battery_stop_monitor(struct battery *thiz);

int32_t battery_register_callback(struct battery *thiz, notify_cb cb, void *context);
void battery_unregiser_callback(struct battery *thiz, void *context);

__END_DECLS;

#endif
